<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <img :src="imgArr[index]">
        <a href="#" @click="up">上一张</a>
        <a href="#" @click="down">下一张</a>
    </div>
    <script>
        var app = new Vue({
            el:'#app',
            data:{
                imgArr:["img/jpzy_01.jpg","img/jpzy_02.jpg","img/jpzy_03.jpg"],
                index:0
            },
            methods:{
                up:function(){
                    if(this.index>0){
                        this.index--;
                    }
                },
                down:function(){
                    if(this.index<this.imgArr.length-1){
                        this.index++;
                    }
                }
            }
        })
    </script>
</body>
</html>